package learn.spring.base.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * @author 执笔
 * @date 2021/7/29  14:15
 */
@Repository
public class UserDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    public void add(String name, Long id) {
        String sql = "INSERT INTO user(NAME, id) VALUES(?,?);";
        int updateResult = jdbcTemplate.update(sql, name, id);
        System.out.println("updateResult:" + updateResult);
    }
}
